<?php
namespace app\sadmin\controller;

use think\Controller;
use think\Db;
use  think\Session;
class Picture extends Controller
{
    public function  plist(){
        $result=Db::query("select*from club_follow c,picture p where c.userid = p.userid  order by p.pictureid desc");
        $this->assign("plist",$result);
        return $this->fetch();
    }
        public function  pupdate($pictureid){
            $result=Db::name("picture")->where("pictureid='$pictureid'")->find();

       if ($result['state']==0)
       {
           $state1=1;
       }
       else{
           $state1=0;
       }
       $res=Db::name("picture")->where("pictureid='$pictureid'")->update(['state'=>$state1]);
        if($res){
            $this->success("成功");
        }else{
            $this->error("失败");
        }
    }

}